package com.yinhe.music.yhmusic.music;

import com.yinhe.music.yhmusic.db.bean.RecentMusicDBEntity;
import com.yinhe.music.yhmusic.db.bean.SongDBEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/21.
 */

public class FileInfo implements Serializable{
            public String mediaid;
            public String type;
            public String duration;
    public List<Playlist> playlist;

    public FileInfo(SongDBEntity songDB){
        this.setMediaid(songDB.getMediaid());
        this.setType(songDB.getType());
        this.setDuration(songDB.getDuration());
        List<Playlist> list = new ArrayList<>();
        list.add(new Playlist(songDB));
        this.playlist = list;
    }

    public FileInfo(RecentMusicDBEntity songDB){
        this.setMediaid(songDB.getMediaid());
        this.setType(songDB.getType());
        List<Playlist> list = new ArrayList<>();
        list.add(new Playlist(songDB));
        this.playlist = list;
    }

    public String getMediaid() {
        return mediaid;
    }

    public void setMediaid(String mediaid) {
        this.mediaid = mediaid;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDuration() {
        return duration;
    }

    public long getDurationLong(){
        if(duration!=null){
            return Long.valueOf(duration);
        }
        return 0;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public List<Playlist> getPlaylist() {
        return playlist;
    }

    public void setPlaylist(List<Playlist> playlists) {
        this.playlist = playlists;
    }
}
